package com.emcom.gotour.vo;

import java.io.Serializable;
import org.apache.commons.lang.builder.CompareToBuilder;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;

public class CategoryVO implements Comparable<Object>, Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = -2221895471106134604L;
	private long id;
	private String typeId;
	private String name;
	private boolean selected;
	public long getId() {
		return id;
	}
	public void setId(long id) {
		this.id = id;
	}
	public String getTypeId() {
		return typeId;
	}
	public void setTypeId(String typeId) {
		this.typeId = typeId;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public boolean isSelected() {
		return selected;
	}
	public void setSelected(boolean selected) {
		this.selected = selected;
	}
	/**
	 * @see java.lang.Comparable#compareTo(Object)
	 */
	public int compareTo(Object object) {
		CategoryVO myClass = (CategoryVO) object;
		return new CompareToBuilder().append(this.id, myClass.id).append(
				this.selected, myClass.selected)
				.append(this.name, myClass.name).append(this.typeId,
						myClass.typeId).toComparison();
	}
	/**
	 * @see java.lang.Object#equals(Object)
	 */
	public boolean equals(Object object) {
		if (!(object instanceof CategoryVO)) {
			return false;
		}
		CategoryVO rhs = (CategoryVO) object;
		return new EqualsBuilder().appendSuper(super.equals(object)).append(
				this.id, rhs.id).append(this.selected, rhs.selected).append(
				this.name, rhs.name).append(this.typeId, rhs.typeId).isEquals();
	}
	/**
	 * @see java.lang.Object#hashCode()
	 */
	public int hashCode() {
		return new HashCodeBuilder(795981791, 1234762089).appendSuper(
				super.hashCode()).append(this.id).append(this.selected).append(
				this.name).append(this.typeId).toHashCode();
	}
	/**
	 * @see java.lang.Object#toString()
	 */
	public String toString() {
		return new ToStringBuilder(this).append("typeId", this.typeId).append(
				"selected", this.selected).append("name", this.name).append(
				"id", this.id).toString();
	}
}
